package main

import (
	"Ljohn/fileTest/opt"
	"fmt"
)

func main() {

	f, err := opt.NewFileWriter("./t1.txt", false)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer f.Close()
	err = f.Write([]byte("hello"), []byte("world"))
	if err != nil {
		fmt.Println(err)
		return
	}
	err = f.Write([]byte("test"), []byte("nihao"))
	if err != nil {
		fmt.Println(err)
		return
	}

	err = f.WriteAt([]byte("1122"), f.Pos())
	if err != nil {
		fmt.Println(err)
		return
	}

	f.WriteString("end..")
}
